package com.map.service.impl;

import com.map.dao.UserDAO;
import com.map.service.UserService;
import com.map.util.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Created by JIAO on 2016/4/12.
 */
@Service
public class UserServiceImpl implements UserService {
    private UserDAO userDAO;
    @Autowired
    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }

    public boolean checkUser(String username, String password) {
        return userDAO.check(username,password);
    }

    @Override
    public boolean addUser(User user) {
        userDAO.addUser(user);
        return true;
    }

    @Override
    public boolean existUser(String username) {
        return userDAO.existUser(username);
    }
}
